using System.ComponentModel.DataAnnotations;
using S.M.SmartMedical.Domain.Enums;

namespace S.M.SmartMedical.Domain.Entities
{
    /// <summary>
    /// 用户实体
    /// </summary>
    public class User : BaseEntity
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required]
        [StringLength(50)]
        public string UserName { get; set; } = string.Empty;

        /// <summary>
        /// 真实姓名
        /// </summary>
        [Required]
        [StringLength(50)]
        public string RealName { get; set; } = string.Empty;

        /// <summary>
        /// 手机号
        /// </summary>
        [StringLength(20)]
        public string? Phone { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(100)]
        public string? Email { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required]
        [StringLength(255)]
        public string Password { get; set; } = string.Empty;

        /// <summary>
        /// 状态
        /// </summary>
        public UserStatus Status { get; set; } = UserStatus.Normal;

        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime? LastLoginTime { get; set; }
    }
}